#include <Length.h>
#include <Unit.h>
#include <UnitFormat.h>


Length::Length(const UnitAmount& value, const Unit& unit)
    :valueMinUnit_m(unit.convert2MinUnit(value))
{
}

bool Length::operator==(const Length& length) const
{
    return valueMinUnit_m ==length.valueMinUnit_m;
}


bool Length::operator!=(const Length& length) const
{
    return !(*this==length);
}

Length Length::operator+( const Length& input)const
{
    UnitAmount value = valueMinUnit_m+input.valueMinUnit_m;
    return Length(value, MINUNIT);
}

void Length::output(std::ostream& out, const UnitFormat& unitFormat) const
{
   unit_m.formatUnitSets(out,value_m,unitFormat);
   unitFormat.unitOutput<lengthUnitSets>(out,valueMinUnit_m, MINUNIT,LENGTH_UNITSET);
}








